package cn.wizzer.app.crown.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.integration.json4excel.annotation.J4EIgnore;

import java.math.BigDecimal;

@Data
@Table("crown_bet_count")
@TableIndexes({@Index(name = "INDEX_USER_DATE", fields = {"userId", "date"}, unique = true),
        @Index(name = "INDEX_CT_AT", fields = {"ctAt"}, unique = false)})
public class CrownBetCount extends BaseModel {

    @Column
    @Name
    @Comment("ID")
    @J4EIgnore
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(uu32 = true)
    private String id;

    @Column
    @Comment("按天统计 2020-06-15")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    private String date;

    @Column()
    @Comment("注单统计(有效)")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    private BigDecimal count;


    @Column
    @Comment("用户ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String userId;

    @Column
    @Comment("上级ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String inviteId;

    @Column
    @Comment("自身返水统计（有效金额里面）")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    private BigDecimal selfIncome;

    @Column
    @Comment("代理的返水")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("0")
    private BigDecimal agentIncome;

    @Column
    @Comment("创建时间")
    //Long不要用ColDefine定义,兼容oracle/mysql,支持2038年以后的时间戳
    private Long ctAt;


}
